/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { HttpSrv } from 'lfun-bg-comp';

export interface Major {
  major_name: string;
  major_no: string;
}

// 分页查询
export const searchMajor = (school_id: any) =>
  HttpSrv().get('/school/v1/major/page', { params: { school_id, page: 1, per_page: 3000 } });
// 获取1级
export const allLv1Major = () =>
  HttpSrv().get('/school/v1/enums/page', { params: { enum_name: 'major' }, page: 1, per_page: 3000 });
// 获取2级
export const allLv2Major = () =>
  HttpSrv().get('/school/v1/enums/page', { params: { enum_name: 'major_lv2', page: 1, per_page: 3000 } });
// 获取3级
export const allLv3Major = () =>
  HttpSrv().get('/school/v1/enums/page', { params: { enum_name: 'major_lv3', page: 1, per_page: 3000 } });
// 修改
export const updateMajor = (school_id: any, majors: Major[]) =>
  HttpSrv().put(`/school/v1/major/?school_id=${school_id}`, majors);

export const allMajor = () =>
  HttpSrv().get('/school/v1/enums/page', { params: { enum_name: 'major,major_lv2' }, page: 1, per_page: 3000 });
